Jobs
Interviews

Solve Case-Insensitive Stable Sort using Lua Language

Solve Case-Insensitive Stable Sort using Lua to enhance your skills with lua coding practice , master coding concepts, and prepare for interviews with practical exercises and detailed solutions.

Case-Insensitive Stable Sort

Difficulty : Easy

Categories :

  • Sorting algorithms

Given an array of strings containing names, sort them in a case-insensitive manner. If two strings are equal when compared case-insensitively, maintain their original order (stable sort).

Constraints:

  • 1 ≤ array.length ≤ 100
  • 1 ≤ name.length ≤ 20
  • Names contain only English letters
  • Must perform stable sorting

Examples:

Input: ["Tom", "alice", "Bob", "aLice"]
Output: ["alice", "aLice", "Bob", "Tom"]
Explanation: Sorted case-insensitively, maintaining original order of "alice" and "aLice"
Input: ["Zebra", "zebra", "cat"]
Output: ["cat", "Zebra", "zebra"]
Explanation: "cat" comes before both "Zebra" and "zebra"

Problem Solving

Input

What You'll Find Here

Real-World Applications Solve problems inspired by Lua's common use cases, such as game development and embedded systems.

Step-by-Step Guidance Break down Lua's concepts into digestible lessons.

Practical Skills Build hands-on experience with Lua for real-world projects.

Choose from the following categories