Jobs
Interviews

Solve Case-Insensitive Stable Sort using Ruby Language

Solve Case-Insensitive Stable Sort using Ruby to enhance your skills with ruby 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 Scenarios Solve problems inspired by common Ruby use cases.

Step-by-Step Guidance Understand the core concepts of Ruby through clear explanations.

Practical Skills Prepare for real-world challenges with hands-on coding exercises.

Choose from the following categories