...

/

Challenge: Locate the First Occurrence

Challenge: Locate the First Occurrence

Test your knowledge by solving this coding challenge.

Introduction

For this challenge, we’re moving away from problems we can solve by a two-pointers approach and instead try something different.

Problem statement

You will have to implement the C library function strchr. This function takes a string and a character as inputs. It returns a pointer to the first occurrence of the character in the string. If the character doesn’t occur in the string, it returns NULL.

The function will look like ...