C Programming – Replace all ‘0’ with ‘5’ in an input Integer – Mathematical Algorithms – The idea is simple, we get the last digit using mod operator ‘%’.
string python
4 Articles
4
C Programming – Calculate the angle between hour hand and minute hand – Mathematical Algorithms – The minute hand moves 360 degree in 60 minute( 6 degree)
Manacher’s Algorithm – Linear Time Longest Palindromic Substring – Searching and sorting – We have already discussed Naïve [O(n3)] and quadratic [O(n2)]
PYTHON Program Count 1’s in a sorted binary array – Searching and Sorting – A simple solution is to linearly traverse the array. The time complexity of the simple solution is O(n). We can use Binary Search to find count in O(Logn) time.