Leetcode 937. Reorder Data in Log Files

Input: logs = ["dig1 8 1 5 1","let1 art can","dig2 3 6","let2 own kit dig","let3 art zero"]
Output: ["let1 art can","let3 art zero","let2 own kit dig","dig1 8 1 5 1","dig2 3 6"]
Explanation:
The letter-log contents are all different, so their ordering is "art can", "art zero", "own kit dig".
The digit-logs have a relative order of "dig1 8 1 5 1", "dig2 3 6".
Input: logs = ["a1 9 2 3 1","g1 act car","zo4 4 7","ab1 off key dog","a8 act zoo"]
Output: ["g1 act car","a8 act zoo","ab1 off key dog","a1 9 2 3 1","zo4 4 7"]

--

--

--

CS new grad, 6 years experience related to supply chain management. Located in Bay area

Love podcasts or audiobooks? Learn on the go with our new app.

LeetCode Day #18 -Minimum Path Sum

Introducing the aws-ssm-agent-installer

Grid vs Flexbox: Which one is better?

Hiring the Right Developer

Day #6 with Cloud Workflows: arrays and dictionaries

Top 50 C Programming Interview Questions and Answers

Authenticate with Discord oAuth2-Provider using Flutter

Installing Unity & Getting Started With Game Development

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gary Chiang

Gary Chiang

CS new grad, 6 years experience related to supply chain management. Located in Bay area

More from Medium

Leetcode 290. Word Pattern

Leetcode 706. Design HashMap

Connect Ropes(code and explanation)

Leetcode Biweekly Contest 69 & Leetcode Weekly Contest 275 Overview