Format Mobile Game Leaderboard Names
Format Mobile Game Leaderboard Names
EasyStrings50% accepted
Ravi develops a mobile game with a competitive leaderboard. Player names must be displayed in a fixed 20-character right-aligned format with rank numbers, showing as '1. Arjun' for proper UI alignment.
Approach
Given player names and ranks, format each as '[rank]. [name right-padded to 20 chars]' with left-padding spaces before the name.
Input
[["Arjun", 1], ["Priya", 2]]
Output
["1. Arjun","2. Priya"]
More Strings problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards