Panda Guru LogoPanda
Guru

Hackerrank SDE Intern OA || OCT 2024

Round 1

Questions: Given a standard QWERTY keyboard, a robot starts from the letter 'Q'. It takes 1 step to reach an adjacent key (horizontally or vertically), and the robot can move in four directions (up, down, left, right). For a given uppercase string s, return the total number of steps the robot would take to type out the string.

Example 1: Input: "QWERTY" Output: 5

Explanation: The robot starts at 'Q' and moves to 'W', 'E', 'R', 'T', 'Y', taking 1 step between each adjacent character.

Example 2: Input: "QZ" Output: 4

Explanation: Q -> W -> A -> S -> Z

Example 3: Input: "PM" Output: 12

Explanation: Q -> W -> E -> R -> T -> Y -> U -> I -> O -> P -> L -> K -> M

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.