Coding Problem: First Non-Repeating Character in Go

Coding Problem: First Non-Repeating Character in Go

Coding Problem: First Non-Repeating Character in Go. Writing coding problems in with my most relevant language to stay sharp on my programming. The First Non-Repeating Character problem is defined by an input of a single string of English characters.

Sharpen your coding skills!

This article is part of my personal habit of writing coding problems in with my most relevant language to stay sharp on my programming and problem solving skills. The First Non-Repeating Character question is a well-known beginner computer science question. Here we will understand the problem, write table-driven tests and develop two solutions using Go.

Let’s code!

Understand The Problem

While the title is fairly self-descriptive, it’s always best to understand a coding problem by first walking through some examples. In our case, the First Non-Repeating Character problem is defined by an input of a single string of English characters and an output of the index of the string’s first non-repeating character. If there are no non-repeating characters, then the function should return -1.

Here are a few examples:

----- Example 1 -----
Input:  abbcddeff
Output: 0
----- Example 2 -----
Input:  abbNadNe
Output: 4
----- Example 3 -----
Input:  ddd
Output: -1

You should always try working out these examples yourself, especially in a coding interview, to gain an initial grasp of the problem. This question can be understood with just a few examples, so now let’s move onto the tests.

tutorial golang technology programming

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Python Programming Tutorials For Beginners

Python Programming Tutorials For Beginners

Golang Tutorial #1 - An Introduction to Go Programming

An introduction to the go programming language for beginners. In this golang tutorial you will learn the basics of go, setup a go lang coding environment and...

Golang Web Development:Th Best Programming Language in 2020

Golang Web Development is the new trend globally. Get all the details about the Golang development here. Hire Golang Developers.

Golang Array Example | Arrays in Go Tutorial Explained

Golang array is a fixed-size collection of items of the same type. The items of an array are stored sequentially and can be accessed using their index.

Create a Golang Video Streaming Server Using HLS - A Tutorial - Qvault

Find out exactly how to create a Golang video streaming server using HLS with this easy tutorial! Format your media and build a server, step-by-step.