Share our channel guys.....i will upload all solutions...✅
👍1
def next_stepping_number(N):
N = str(N)
for i in range(len(N) - 1):
if abs(int(N[i]) - int(N[i+1])) != 1:
return int(N[:i+1] + str(int(N[i]) + 1 if int(N[i]) < int(N[i+1]) else int(N[i]) - 1) + '9'*(len(N)-i-1))
return int(N) + 1
print(next_stepping_number(4))
python3✅
N = str(N)
for i in range(len(N) - 1):
if abs(int(N[i]) - int(N[i+1])) != 1:
return int(N[:i+1] + str(int(N[i]) + 1 if int(N[i]) < int(N[i+1]) else int(N[i]) - 1) + '9'*(len(N)-i-1))
return int(N) + 1
print(next_stepping_number(4))
python3✅
👍1
All codes uploaded check above..👆👆
Guys...pls...share our channel i will provide.solutions here...don`t spam msg me...✅✅
def getLargestString(s, k):
frequency_array = [0] * 26
for i in range(len(s)):
frequency_array[ord(s[i]) -
ord('a')] += 1
ans = ""
i = 25
while i >= 0:
if (frequency_array[i] > k):
temp = k
st = chr( i + ord('a'))
while (temp > 0):
ans += st
temp -= 1
frequency_array[i] -= k
j = i - 1
while (frequency_array[j] <= 0 and
j >= 0):
j -= 1
if (frequency_array[j] > 0 and
j >= 0):
str1 = chr(j + ord( 'a'))
ans += str1
frequency_array[j] -= 1
else:
break
elif (frequency_array[i] > 0):
temp = frequency_array[i]
frequency_array[i] -= temp
st = chr(i + ord('a'))
while (temp > 0):
ans += st
temp -= 1
else:
i -= 1
return ans
if name == "main":
S = input()
k = 3
print (getLargestString(S, k))
Python
Bob code✅✅
Telegram:- @Coding_000✅
frequency_array = [0] * 26
for i in range(len(s)):
frequency_array[ord(s[i]) -
ord('a')] += 1
ans = ""
i = 25
while i >= 0:
if (frequency_array[i] > k):
temp = k
st = chr( i + ord('a'))
while (temp > 0):
ans += st
temp -= 1
frequency_array[i] -= k
j = i - 1
while (frequency_array[j] <= 0 and
j >= 0):
j -= 1
if (frequency_array[j] > 0 and
j >= 0):
str1 = chr(j + ord( 'a'))
ans += str1
frequency_array[j] -= 1
else:
break
elif (frequency_array[i] > 0):
temp = frequency_array[i]
frequency_array[i] -= temp
st = chr(i + ord('a'))
while (temp > 0):
ans += st
temp -= 1
else:
i -= 1
return ans
if name == "main":
S = input()
k = 3
print (getLargestString(S, k))
Python
Bob code✅✅
Telegram:- @Coding_000✅
👍2
Take screenshot of my channel and share to large groups if u need more answers❤️😍
❤4