Find the first un-repeated character in a string

后端 未结 30 1283
猫巷女王i
猫巷女王i 2020-11-27 18:29

What is the quickest way to find the first character which only appears once in a string?

30条回答
  •  遥遥无期
    2020-11-27 19:01

    This snippet code in JavaScript

    var string = "tooth";
    var hash = [];
    for(var i=0; j=string.length, i

提交回复
热议问题