I have one more approach in mind where it requires T(n) = O(n) and
O(1) space complexity. here it goes:
1) Start traversing the array.
2)Store the location when 0 and 1 both appears for the first time in
some variable.
3)Similarly store the location of 0 and 1 when both appears for the
last time i
On Jul 5, 4:04 am, Dumanshu wrote:
> ans1. use counting sort for character array (0 to 255) then check for
> the second string if same or not.
>
> ans2. send 1 and 2, 1 comes back, send 10 and 5, 2 comes back, send 2
> and 1
>
> ans3. As vikas said, sum of digits should b 8. In that case the num
Yes I am also getting the same.
On Jul 5, 12:50 am, Ritesh Srivastava
wrote:
> For Q3 .
> Sum of all the digits should be 8.
>
> I think ,
> 42101000 is an answer.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send