Skip to content

Instantly share code, notes, and snippets.

@p-subudhi
Created April 29, 2019 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p-subudhi/60b11a2f316ea789b129227df964d341 to your computer and use it in GitHub Desktop.
Save p-subudhi/60b11a2f316ea789b129227df964d341 to your computer and use it in GitHub Desktop.
1. Find frequency of characters in a string given
print the top 3 frequent occuring character and their occurance count
For Exemple:
input "aabbbccccddd"
output
c 4
b 3
d 3
2. You have been given a number 'x', Find next nearest number which is divisible by 'n'
Exemple:
input x=13, n =5
output 15
Exemple:
input x=23, n =10
output 30
3. You have been given number 'n', find the square root of 'n' without using any predefined function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment