CtCI-6th-Edition-cpp icon indicating copy to clipboard operation
CtCI-6th-Edition-cpp copied to clipboard

Solve is_unique with map

Open quangnhat185 opened this issue 4 years ago • 1 comments

A solution for this problem using map

quangnhat185 avatar Oct 11 '21 18:10 quangnhat185

The loop is odd here. Why not like bellow?

if (character_counts[c] == 1)
  return false;

You are absolutely right, my loop is purely abundant :smile:

quangnhat185 avatar Oct 11 '21 18:10 quangnhat185