Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a program that converts a hash to an array of key-value pairs.

Easy

Problem Statement

Write a program that converts a hash to an array of key-value pairs.

Sample Input

{a: 1, b: 2, c: 3}

Sample Output

[[:a, 1], [:b, 2], [:c, 3]]

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
# Predefined hash hash = {a: 1, b: 2, c: 3} # Your logic here
Log in or sign up to run or submit your code.Log inSign up
Input
{a: 1, b: 2, c: 3}
Expected Output
[[:a, 1], [:b, 2], [:c, 3]]