Java Rotate Array K Times
Problem : Given of size ‘n’ and a values ‘k’ around which we need to right rotate the array. Array: [1,2,3,4,5,6,7], K = 3 Rorate1: 7,1,2,3,4,5,6 Rotate2: 6,7,1,2,3,4,5 Rotate3: 5,6,7,1,2,3,4 Solution…
Problem : Given of size ‘n’ and a values ‘k’ around which we need to right rotate the array. Array: [1,2,3,4,5,6,7], K = 3 Rorate1: 7,1,2,3,4,5,6 Rotate2: 6,7,1,2,3,4,5 Rotate3: 5,6,7,1,2,3,4 Solution…
This is one of the most common datastructure interview questions and to validate parenthesis. Examples of valid parentheses: (()){}{} Examples of Invalid parentheses : ({) or {(((()))) Problem: Given a…
In this post we will see various approaches in deleting duplicate elements from Array List Input [Jay, Jay, TEJA, SANDEEP, RAMU, VINODD, bharath, Ranga, RAJA, Konda, Pavan, King, sridhar, Jay,…