Jobs
Interviews

Solve First Non-repeating Character using Lua Language

Solve First Non-repeating Character using Lua to enhance your skills with lua coding practice , master coding concepts, and prepare for interviews with practical exercises and detailed solutions.

First Non-repeating Character

Difficulty : Easy

Categories :

  • Strings

Given a string containing only lowercase letters, create a function that returns the index of the first non-repeating character in the string. If there is no non-repeating character, return -1.

Constraints:

  • 1 ≤ string length ≤ 10⁵
  • String contains only lowercase English letters

Examples:

Input: s = "leetcode"
Output: 0
Explanation: 'l' is the first character that appears only once.
Input: s = "aabb"
Output: -1
Explanation: There are no characters that appear only once.

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