{"author":{"email":"alex@hayorov.me","name":"Alex Khaerov","url":"https://hayorov.me/"},"content_markdown":"> 🧩 Challenge: Normalize table row lengths\n> 🐍 Language: Python\n\n## 📋 Problem\n\nGiven a structure that represents a data table:\n\n```python\n[\n [foo:42, baz:7],\n [foo:45, bar:8, baz:9],\n]\n```\n\nN rows, M items in a row, an item is `<label>:<value>`\n\nReturn a new structure with null values for items with no label — ensuring constant row length.\n\n## ✅ Expected Output\n\n```python\n[\n    [foo:42, bar:7, baz:null],\n    [foo:45, bar:8, baz:9],\n]\n```\n\n## 🔁 Edge Case: Repeating Labels\n\nLabels can repeat arbitrarily:\n\n```python\n[\n    [foo:42, foo:99, bar:7, foo:77],\n    [foo:45, baz:9, baz:9, bar:8, baz:9, baz:10],\n]\n```\n\nThe order of labels in the output can be arbitrary.\n\n## ⚠️ Limitations\n\nN < 10^6, M < 10^6","content_text":"🧩 Challenge: Normalize table row lengths 🐍 Language: Python\n📋 Problem # Given a structure that represents a data table:\n[ [foo:42, baz:7], [foo:45, bar:8, baz:9], ] N rows, M items in a row, an item is <label>:<value>\nReturn a new structure with null values for items with no label — ensuring constant row length.\n✅ Expected Output # [ [foo:42, bar:7, baz:null], [foo:45, bar:8, baz:9], ] 🔁 Edge Case: Repeating Labels # Labels can repeat arbitrarily:\n[ [foo:42, foo:99, bar:7, foo:77], [foo:45, baz:9, baz:9, bar:8, baz:9, baz:10], ] The order of labels in the output can be arbitrary.\n⚠️ Limitations # N < 10^6, M < 10^6\n","date":"2020-05-02T00:00:00Z","description":"Python coding challenge: normalize table row lengths by filling missing labels with null values.","json_url":"https://hayorov.me/posts/for-all-rows/index.json","language":"en","lastmod":"2026-04-14T01:12:05+08:00","markdown_url":"https://hayorov.me/posts/for-all-rows/index.md","reading_time_minutes":1,"section":"posts","tags":["python","coding-challenge"],"title":"Challenge #1: Modify a table data","type":"article","url":"https://hayorov.me/posts/for-all-rows/","word_count":108}