⌘K
Flycodx

Amazon Warehouse Aisle Product Grouping

Amazon Warehouse Aisle Product Grouping

EasyStrings0% accepted

Amazon's Bangalore warehouse uses a location encoding system for products. Each location code has the format SRSRS (like 'A5B2C7'). Ravi needs to extract all products by aisle letter (first character) and group them together to optimize picking routes.

Approach

Given a comma-separated list of warehouse location codes (like 'A5B2C7,B3A1D2'), extract the first letter (aisle identifier) from each code and return unique aisles with their product counts in format 'AisleX:Count', sorted alphabetically.

Input

A5B2C7,B3A1D2,A2C4B1

Output

A:2,B:1
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
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3