Total time:- 60 mins
Total Questions:- 3
Platform:-Codesignal
Question 1:-
Given a number in base 2 convert it into base 6.
Max length:-100
Question 2:-
Bob is painting a wall. The wall contains N Sections and he has already painted some sections of the wall
randomly. The wall consists of a string of length N containing lower-case alphabets 'a' to 'z' denoting the
color of the section. in 1 operation. Bob can paint a single section of the wall to any new colour. He is now tired and does not want to do more than k operations. So, he decides to create a continuous segment of the wall which is completely the same colour (a range [i, j] where all wallſk] are equal, i <= K <= 1) What is the maximum length of such a segment he can Create.
Constraints
1<= N <= 510^5
wall = 'a' to z
0<= k <=510^5
Question 3:-
Bowser had captured Princess Peach and has imprisoned
her in the bottom-right comer of his castle The prison consists of mx n rooms laid out in a 2D grid. Super Mario has come to her rescue. The entry gate of the prison in the castle is positioned in the top-left room le prison[0][0] and Mario must fight all his way through the prison to save his princess (who is in bottom right corner of the Before entering the castle Mario has an initial health score represented by a positive integer. If at any point his
health score drops to 0 or below, he dies immediately. Some of the rooms are guarded by dernons (represented by negative integers) so Mario loses his health upon entering these rooms; other rooms are either empty
(represented as 0) or contain magic orbs & power-ups thal increase Marlo's health (represented by positive integers). To reach the princess quickly, Mario decides to move only rightward or downward in each step.
Find the Mario's minimum initial health score so that he can save princess.
https://leetcode.com/problems/dungeon-game/