    # In ký tự không lặp lại đầu tiên trong một chuỗi trong C++

Cho một chuỗi, tìm ký tự không lặp lại đầu tiên trong đó. Ví dụ: nếu chuỗi đầu vào là "GeeksforGeeks", thì đầu ra phải là 'f' và nếu chuỗi đầu vào là "GeeksQuiz", thì đầu ra phải là 'G'

Show

Chúng ta có thể sử dụng các ký tự chuỗi làm chỉ mục và xây dựng một mảng đếm. Sau đây là thuật toán

```1) Scan the string from left to right and construct the count array.
2) Again, scan the string from left to right and check for count of each
character, if you find an element who's count is 1, return it.
```

Thí dụ

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```

Thực hiện

## C/C++

`// C program to find first non-repeating character`

`#include`

`#include`

`#define NO_OF_CHARS 256`

` `

`/* Returns an array of size 256 containg count`

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
1

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
5

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
9
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
`First non-repeating character is f`
1
`First non-repeating character is f`
2
`First non-repeating character is f`
3
`First non-repeating character is f`
4
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
`First non-repeating character is f`
7

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
`First non-repeating character is f`
0

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
`First non-repeating character is f`
2
`First non-repeating character is f`
3

`First non-repeating character is f`
4
`First non-repeating character is f`
5

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
`First non-repeating character is f`
7
`First non-repeating character is f`
8

`First non-repeating character is f`
9

` `

`// C program to find first non-repeating character`1

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0`// C program to find first non-repeating character`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0`// C program to find first non-repeating character`5

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `// C program to find first non-repeating character`7
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
5

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`1

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `#include`3

`#include`1

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `#include`6

` `

`#include`1

`First non-repeating character is f`
2
`First non-repeating character is f`
3

`#include`1_______1_______6

`#include`3____765_______4 `#include`5

`#include`3____1_______6

`First non-repeating character is f`
4`#include`9

`First non-repeating character is f`
4`#define NO_OF_CHARS 256`1`#define NO_OF_CHARS 256`2

`#include`3`#define NO_OF_CHARS 256`4

`#include`1____766_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0

`#include`1`#define NO_OF_CHARS 256`9` `0` `1

`#include`1____13_______7 ` `4

`First non-repeating character is f`
9

` `

` `7

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 ` `9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`1

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4 `/* Returns an array of size 256 containg count`3`/* Returns an array of size 256 containg count`4`#define NO_OF_CHARS 256`2

`#include`1

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `/* Returns an array of size 256 containg count`8

`#include`1____765_______4

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
01

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
03
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
05
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
06

`#include`1_______1_______08

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
03
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
12
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
13

`#include`1_______1_______15

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
16

`#include`1____13_______7

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
19

`First non-repeating character is f`
9

## Java

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
21

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
23
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
24

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
28
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
30
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
31`#define NO_OF_CHARS 256`2

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
36
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
37
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
39

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
42

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
43
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
44

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40_______1_______27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
47
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
48

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40_______1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51
`First non-repeating character is f`
2
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
55
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
56
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
57

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
58
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
59

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40_______13_______9

`First non-repeating character is f`
4

`#include`3_______1_______64

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
43`// C program to find first non-repeating character`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
43`// C program to find first non-repeating character`5

`#include`3____1_______27

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
72

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
76

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
79
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
80_______1_______81

`First non-repeating character is f`
4

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
85
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
56
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
57

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#include`4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
92
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
80
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
94

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
97`#include`9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
97`#define NO_OF_CHARS 256`1`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#define NO_OF_CHARS 256`4

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#define NO_OF_CHARS 256`6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
43

`First non-repeating character is f`
4
`First non-repeating character is f`
7 ` `4

`#include`3

`First non-repeating character is f`
9

` `

`#include`3

`First non-repeating character is f`
14

`#include`3

`First non-repeating character is f`
16
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
47
`First non-repeating character is f`
19

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
23`/* Returns an array of size 256 containg count`4`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `/* Returns an array of size 256 containg count`8

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
31
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
80
`First non-repeating character is f`
33
`First non-repeating character is f`
34
`First non-repeating character is f`
35

`First non-repeating character is f`
36_______13_______37
`First non-repeating character is f`
38
`First non-repeating character is f`
39
`First non-repeating character is f`
40

`#include`3

`First non-repeating character is f`
9

`First non-repeating character is f`
9

## con trăn

`First non-repeating character is f`
44

`First non-repeating character is f`
45_______13_______46
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
31

` `

`First non-repeating character is f`
49

`First non-repeating character is f`
50

`First non-repeating character is f`
51
`First non-repeating character is f`
52

`#include`3

`First non-repeating character is f`
54
`First non-repeating character is f`
46
`First non-repeating character is f`
56
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
56
`First non-repeating character is f`
58
`First non-repeating character is f`
59
`First non-repeating character is f`
45

`#include`3

`First non-repeating character is f`
2
`First non-repeating character is f`
63
`First non-repeating character is f`
64
`First non-repeating character is f`
65

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
67
`First non-repeating character is f`
68
`First non-repeating character is f`
69
`First non-repeating character is f`
35
`First non-repeating character is f`
46
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
80

`#include`3

`First non-repeating character is f`
7
`First non-repeating character is f`
54

` `

`First non-repeating character is f`
77

`First non-repeating character is f`
78

`First non-repeating character is f`
79

`First non-repeating character is f`
51
`First non-repeating character is f`
81

`#include`3

`First non-repeating character is f`
54
`First non-repeating character is f`
46
`First non-repeating character is f`
85

`#include`3

`First non-repeating character is f`
87
`First non-repeating character is f`
46
`First non-repeating character is f`
89
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
80

`#include`3

`First non-repeating character is f`
92
`First non-repeating character is f`
46
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
56

` `

`#include`3

`First non-repeating character is f`
2
`First non-repeating character is f`
63
`First non-repeating character is f`
64
`First non-repeating character is f`
65

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#include`4
`First non-repeating character is f`
67_______13_______68
`First non-repeating character is f`
69
`First non-repeating character is f`
46
`First non-repeating character is f`
46
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
80
`First non-repeating character is f`
38

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
`First non-repeating character is f`
87
`First non-repeating character is f`
46
`First non-repeating character is f`
92

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#define NO_OF_CHARS 256`1

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
92
`First non-repeating character is f`
35
`First non-repeating character is f`
46
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
80

` `

`#include`3

`First non-repeating character is f`
7
`First non-repeating character is f`
87

` `

`First non-repeating character is f`
26

`First non-repeating character is f`
27_______13_______46 `/* Returns an array of size 256 containg count`4

`First non-repeating character is f`
87
`First non-repeating character is f`
46
`First non-repeating character is f`
32

`#include`4

`First non-repeating character is f`
87
`First non-repeating character is f`
46
`First non-repeating character is f`
46
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
80
`First non-repeating character is f`
38

`#include`3____13_______40

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
05

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
08
`First non-repeating character is f`
38

`#include`3

`First non-repeating character is f`
40
`First non-repeating character is f`
39
`First non-repeating character is f`
35
`First non-repeating character is f`
48

` `

`First non-repeating character is f`
50

## C#

`First non-repeating character is f`
51

`First non-repeating character is f`
52
`First non-repeating character is f`
53

`First non-repeating character is f`
52
`First non-repeating character is f`
55

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
23
`First non-repeating character is f`
58

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

`#include`3____1_______27

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
`First non-repeating character is f`
63

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4
`First non-repeating character is f`
67
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
37
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
39

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
42

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
44

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
47
`First non-repeating character is f`
79_______13_______27
`First non-repeating character is f`
81

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
2
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
`First non-repeating character is f`
88

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
`First non-repeating character is f`
90

`#include`3

`First non-repeating character is f`
9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

`#include`3_______1_______64

`#include`3

`First non-repeating character is f`
97

`#include`3____13_______99

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `// C program to find first non-repeating character`7
`First non-repeating character is f`
27 `// C program to find first non-repeating character`05

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
76

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `#include`6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
2 `// C program to find first non-repeating character`16

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#include`4 `// C program to find first non-repeating character`21

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
97`#include`9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
97`#define NO_OF_CHARS 256`1`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`// C program to find first non-repeating character`30

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`// C program to find first non-repeating character`30

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51

`#include`3

`First non-repeating character is f`
7 ` `4

`#include`3

`First non-repeating character is f`
9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

`#include`3`// C program to find first non-repeating character`41

`#include`3

`First non-repeating character is f`
16
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
47 `// C program to find first non-repeating character`46

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
27 `// C program to find first non-repeating character`51`/* Returns an array of size 256 containg count`4`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `// C program to find first non-repeating character`56

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`// C program to find first non-repeating character`59`// C program to find first non-repeating character`60
`First non-repeating character is f`
35

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`// C program to find first non-repeating character`63
`First non-repeating character is f`
35

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
37
`First non-repeating character is f`
38`// C program to find first non-repeating character`68

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
35`// C program to find first non-repeating character`71 `// C program to find first non-repeating character`72

`#include`3

`First non-repeating character is f`
9

`First non-repeating character is f`
9

` `

`// C program to find first non-repeating character`77

## PHP

`// C program to find first non-repeating character`78

`// C program to find first non-repeating character`79

`// C program to find first non-repeating character`80

`// C program to find first non-repeating character`81

`// C program to find first non-repeating character`82 `// C program to find first non-repeating character`83

`// C program to find first non-repeating character`84____13_______46____763_______86`// C program to find first non-repeating character`87

` `

`// C program to find first non-repeating character`89

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0`// C program to find first non-repeating character`91

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0`// C program to find first non-repeating character`93

`// C program to find first non-repeating character`94

`First non-repeating character is f`
79`// C program to find first non-repeating character`96`// C program to find first non-repeating character`97

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`3`#include`00 `// C program to find first non-repeating character`84`#define NO_OF_CHARS 256`2

`#include`3

`First non-repeating character is f`
2
`First non-repeating character is f`
3`#include`06 `#include`07

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51`#include`06 `#include`10`#include`11
`First non-repeating character is f`
3`// C program to find first non-repeating character`96
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
06_______764_______06`#include`16

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`// C program to find first non-repeating character`84`#include`19`// C program to find first non-repeating character`96
`First non-repeating character is f`
56`#include`06`#include`23

`First non-repeating character is f`
9

` `

`#include`26

`#include`27

`#include`28

`#include`29

`// C program to find first non-repeating character`5

`// C program to find first non-repeating character`94 `// C program to find first non-repeating character`7`// C program to find first non-repeating character`96

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
94

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`3`#include`00 `// C program to find first non-repeating character`84`#define NO_OF_CHARS 256`2

`#include`3

`First non-repeating character is f`
79`// C program to find first non-repeating character`96
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
06

`#include`3____764_______45 `#include`46

`#include`3

`First non-repeating character is f`
2
`First non-repeating character is f`
3`#include`06 `#include`07

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51`#include`06 `#include`10`#include`11
`First non-repeating character is f`
3`// C program to find first non-repeating character`96
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
06_______764_______06`#include`16

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#include`4
`First non-repeating character is f`
3`// C program to find first non-repeating character`84`#include`19`// C program to find first non-repeating character`96
`First non-repeating character is f`
56`#include`06`#include`71

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#include`45
`First non-repeating character is f`
46`#include`06`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#define NO_OF_CHARS 256`1`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`// C program to find first non-repeating character`30

`#include`3____763_______30

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

`First non-repeating character is f`
7 `#include`45`#define NO_OF_CHARS 256`2

`First non-repeating character is f`
9

` `

`// C program to find first non-repeating character`41

`// C program to find first non-repeating character`96

`First non-repeating character is f`
46`/* Returns an array of size 256 containg count`4`#define NO_OF_CHARS 256`2

`#include`45 `#include`98`// C program to find first non-repeating character`96

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
06

`#include`4

`First non-repeating character is f`
3`#include`45 `#include`04

`#include`05 `#include`06 `#include`07

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40_______765_______09`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
08

`#include`05 `#include`13`#include`07

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#include`16`#include`17

`#include`18`// C program to find first non-repeating character`96

`First non-repeating character is f`
56`#include`45`#include`22

` `

`#include`24

`#include`25

đầu ra.
`First non-repeating character is f`

Chúng ta có thể làm điều đó bằng cách duyệt qua chuỗi chỉ một lần không?
Cách tiếp cận trên mất O(n) thời gian, nhưng trong thực tế, nó có thể được cải thiện. Phần đầu tiên của thuật toán chạy qua chuỗi để xây dựng mảng đếm (trong thời gian O(n)). Điều này là hợp lý. Nhưng phần thứ hai về việc chạy lại chuỗi chỉ để tìm bộ không lặp lại đầu tiên là không tốt trong thực tế. Trong các tình huống thực tế, chuỗi của bạn sẽ lớn hơn nhiều so với bảng chữ cái của bạn. Lấy trình tự DNA chẳng hạn. chúng có thể dài hàng triệu chữ cái với bảng chữ cái chỉ có 4 chữ cái. Điều gì xảy ra nếu bộ lặp không ở cuối chuỗi?
Chúng ta có thể tăng mảng đếm bằng cách lưu trữ không chỉ số đếm mà còn cả chỉ số của lần đầu tiên bạn gặp ký tự e. g. (3, 26) cho 'a' có nghĩa là 'a' được đếm 3 lần và lần đầu tiên nó được nhìn thấy là ở vị trí 26. Vì vậy, khi cần tìm phần tử không lặp lại đầu tiên, chúng ta chỉ cần quét mảng đếm, thay vì chuỗi. Cảm ơn Ben đã đề xuất phương pháp này

Sau đây là triển khai phương pháp mở rộng chỉ duyệt qua chuỗi đầu vào một lần

## C++

`#include`26

`// C program to find first non-repeating character`81

`#include`28

`First non-repeating character is f`
52 `#include`30 `#include`31

`#define NO_OF_CHARS 256`

` `

`#include`34

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0`#include`36

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0`#include`38

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0`#include`40

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `// C program to find first non-repeating character`7
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
5

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`3`#include`47

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2`#include`49
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2`#include`51

` `

`#include`3

`First non-repeating character is f`
2
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `#include`57

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#include`61

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#include`63

`#include`3

`First non-repeating character is f`
9

` `

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `#include`69

`#include`3

`First non-repeating character is f`
2
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `#include`74

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#include`77

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#include`79

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#include`81

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#include`83

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#include`4 `#include`86

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#include`88

` `

`#include`3

`First non-repeating character is f`
7 `#include`92

`First non-repeating character is f`
9

` `

` `7

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 ` `9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4 `/* Returns an array of size 256 containg count`3`/* Returns an array of size 256 containg count`4`#define NO_OF_CHARS 256`2

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `// C program to find first non-repeating character`56

`#include`3____765_______4 `#define NO_OF_CHARS 256`09

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
03
`First non-repeating character is f`
3`#define NO_OF_CHARS 256`13

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
58`#define NO_OF_CHARS 256`15
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
06

`#include`3_______1_______08

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
03
`First non-repeating character is f`
3`// C program to find first non-repeating character`68

`#include`18`#define NO_OF_CHARS 256`24

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
13

`#include`3____13_______7

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
19

`First non-repeating character is f`
9

## C

`#define NO_OF_CHARS 256`30

`#define NO_OF_CHARS 256`31

`#define NO_OF_CHARS 256`32

`#define NO_OF_CHARS 256`

` `

`#define NO_OF_CHARS 256`35

`#define NO_OF_CHARS 256`36

`#define NO_OF_CHARS 256`37 `#define NO_OF_CHARS 256`38

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
`First non-repeating character is f`
8

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 ` `4

`#define NO_OF_CHARS 256`45

` `

`#define NO_OF_CHARS 256`47

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0`#define NO_OF_CHARS 256`49

`#define NO_OF_CHARS 256`37 `#define NO_OF_CHARS 256`51

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
5

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0`#define NO_OF_CHARS 256`37 `#define NO_OF_CHARS 256`57

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
3`#define NO_OF_CHARS 256`37 `#define NO_OF_CHARS 256`61
`First non-repeating character is f`
2
`First non-repeating character is f`
3
`First non-repeating character is f`
4`#define NO_OF_CHARS 256`65

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
`First non-repeating character is f`
0

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
`First non-repeating character is f`
2
`First non-repeating character is f`
3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`First non-repeating character is f`
4`#define NO_OF_CHARS 256`75

` `

`First non-repeating character is f`
4`#define NO_OF_CHARS 256`78

`First non-repeating character is f`
4`#include`4 `#define NO_OF_CHARS 256`81

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51`#define NO_OF_CHARS 256`83

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
`First non-repeating character is f`
9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
`First non-repeating character is f`
7
`First non-repeating character is f`
8

`First non-repeating character is f`
9

` `

`#define NO_OF_CHARS 256`91

`#include`3____766_______93

`#include`3____766_______95

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `// C program to find first non-repeating character`7
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
5

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`1`#define NO_OF_CHARS 256`37 ` `03

`#include`1

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 ` `06

` `

`#include`1

`First non-repeating character is f`
2 ` `10

`#include`1_______1_______6

`#include`3` `14

`#include`3` `16

`#include`3____765_______4 ` `19

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
43` `21

`#include`1

`First non-repeating character is f`
9

` `

`#include`1`#define NO_OF_CHARS 256`9` `0` `1

`#include`1

`First non-repeating character is f`
7 ` `31

`First non-repeating character is f`
9

` `

` `7

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 ` `9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`1

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4 `/* Returns an array of size 256 containg count`3`/* Returns an array of size 256 containg count`4`#define NO_OF_CHARS 256`2

`#include`1

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `/* Returns an array of size 256 containg count`8

`#include`1`#include`4 `#define NO_OF_CHARS 256`09

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
03
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
05
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
06

`#include`1_______1_______08

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
0
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
03
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
12
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
13

`#include`1_______1_______15

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
16

`#include`1____13_______7

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
19

`First non-repeating character is f`
9

## Java

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
21

` `69

` `

` `71 ` `72

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
23 ` `75

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 ` `79

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

`#include`3` `82

`#include`3

`First non-repeating character is f`
16 ` `85
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 ` `87

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75` `89` `90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
80`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75_______767_______89` `95

`#include`3

`First non-repeating character is f`
9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

`#include`3____768_______00

`#include`3

`First non-repeating character is f`
16
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
47 `/* Returns an array of size 256 containg count`04

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75` `89`/* Returns an array of size 256 containg count`07

`#include`3

`First non-repeating character is f`
9

`First non-repeating character is f`
9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
23
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
24

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
28
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
30
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
31`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27 `/* Returns an array of size 256 containg count`24
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
37 `/* Returns an array of size 256 containg count`26

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
42

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
43
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
44

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40_______1_______27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
47
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
48

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40_______1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51
`First non-repeating character is f`
2
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
55
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
56
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
57

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`/* Returns an array of size 256 containg count`48

`/* Returns an array of size 256 containg count`49____765_______4`/* Returns an array of size 256 containg count`51

`/* Returns an array of size 256 containg count`49____1_______6

`/* Returns an array of size 256 containg count`54`/* Returns an array of size 256 containg count`55

`/* Returns an array of size 256 containg count`54`/* Returns an array of size 256 containg count`57

`/* Returns an array of size 256 containg count`49____13_______9

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
58

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`/* Returns an array of size 256 containg count`62

`/* Returns an array of size 256 containg count`49____1_______08

`/* Returns an array of size 256 containg count`49____1_______6

`/* Returns an array of size 256 containg count`54____768_______68

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
37 `/* Returns an array of size 256 containg count`70

`/* Returns an array of size 256 containg count`49____13_______9

`/* Returns an array of size 256 containg count`73

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51`/* Returns an array of size 256 containg count`75

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
40_______13_______9

`First non-repeating character is f`
4

`#include`3_______1_______64

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
43`// C program to find first non-repeating character`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
43`// C program to find first non-repeating character`5

`#include`3____1_______27

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
72

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
76

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `/* Returns an array of size 256 containg count`95

`First non-repeating character is f`
4

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
85
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
56
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
57

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`/* Returns an array of size 256 containg count`49` `14

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90` `16

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#include`4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
010
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
80
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
012

`/* Returns an array of size 256 containg count`54

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
014

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
`First non-repeating character is f`
9

`#include`18

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75`#define NO_OF_CHARS 256`6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
43

`First non-repeating character is f`
4
`First non-repeating character is f`
7 ` `31

`#include`3

`First non-repeating character is f`
9

` `

`#include`3

`First non-repeating character is f`
14

`#include`3

`First non-repeating character is f`
16
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
47
`First non-repeating character is f`
19

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
23`/* Returns an array of size 256 containg count`4`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `/* Returns an array of size 256 containg count`8

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
51

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
045
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
046
`First non-repeating character is f`
35

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
58
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
049
`First non-repeating character is f`
38
`First non-repeating character is f`
39
`First non-repeating character is f`
40

`#include`3

`First non-repeating character is f`
9

`First non-repeating character is f`
9

## C#

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
056

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
057

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
058

`First non-repeating character is f`
52
`First non-repeating character is f`
53

`First non-repeating character is f`
52
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
062

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
23 ` `75

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`3

`First non-repeating character is f`
16
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
070

` `

`#include`3_______1_______073

`#include`3

`First non-repeating character is f`
16 ` `85
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
078

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75` `89
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
083

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75_______767_______89` `95

`#include`3

`First non-repeating character is f`
9

` `

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
091

`#include`3

`First non-repeating character is f`
16
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
094
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
47
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
096

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75` `89`/* Returns an array of size 256 containg count`07

`#include`3

`First non-repeating character is f`
9

`First non-repeating character is f`
9

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
23
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
107

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

`#include`3

`First non-repeating character is f`
16
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
111
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
`First non-repeating character is f`
63

` `

`#include`3

`First non-repeating character is f`
16
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
118_______1_______4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
120

`/* Returns an array of size 256 containg count`73

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
122_______1_______37
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
118
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
4`#include`49

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
127____1_______128

` `

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
42

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
44

`#include`3

`First non-repeating character is f`
16
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
47
`First non-repeating character is f`
79
`First non-repeating character is f`
27 `// C program to find first non-repeating character`05

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
2
`First non-repeating character is f`
3
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
`First non-repeating character is f`
88

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`/* Returns an array of size 256 containg count`48

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#include`4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
154

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
97
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
158

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
97
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
160

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
`First non-repeating character is f`
9

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
165

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
167

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
08

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
97
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
173
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
37
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
175

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
`First non-repeating character is f`
9

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
9

`#include`3

`First non-repeating character is f`
9

` `

`#include`3_______1_______185

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
187

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
189

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
191

`#include`3

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
193
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `// C program to find first non-repeating character`7
`First non-repeating character is f`
27 `// C program to find first non-repeating character`05

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
76

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
205
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2_______1_______207

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
2 `// C program to find first non-repeating character`16

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
215

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
217

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
219

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90`#include`4
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
222

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
97
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
224

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
97
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
228

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
90
`First non-repeating character is f`
9

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
9

` `

`#include`3

`First non-repeating character is f`
7 ` `31

`#include`3

`First non-repeating character is f`
9

` `

`#include`3_______1_______242

`#include`3

`First non-repeating character is f`
16
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
47
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
247
`First non-repeating character is f`
27
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
249

`#include`3____1_______6

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
`First non-repeating character is f`
27 `// C program to find first non-repeating character`51`/* Returns an array of size 256 containg count`4`#define NO_OF_CHARS 256`2

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2 `// C program to find first non-repeating character`56

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
75
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
262
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
2
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
264

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
265
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
046
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
267

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
265
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
049
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
270

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
265
`First non-repeating character is f`
39
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
267

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
274
```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
275

`#include`3

`First non-repeating character is f`
9

`First non-repeating character is f`
9

` `

```Input string: str = geeksforgeeks
1: Construct character count array from the input string.
....
count['e'] = 4
count['f'] = 1
count['g'] = 2
count['k'] = 2
……
2: Get the first character who's count is 1 ('f').

```
280

đầu ra.
`First non-repeating character is f`

vấn đề liên quan. Ký tự không lặp K’th

Vui lòng viết bình luận nếu bạn thấy bất cứ điều gì không chính xác hoặc bạn muốn chia sẻ thêm thông tin về chủ đề thảo luận ở trên 