Giter Club home page Giter Club logo

Comments (4)

lifei6671 avatar lifei6671 commented on July 21, 2024

不允许使用其他数据结构。你这里使用了map。

from interview-go.

gq-tang avatar gq-tang commented on July 21, 2024

哦,那改成这样可以吧?

func isUniqueString(s string) bool {
	if len(s) > 256 {
		return false
	}

	for _, v := range s {
		if v > 256 {
			return false
		}
		if strings.Count(s, string(v)) > 1 {
			return false
		}
	}
	return true
}

from interview-go.

lifei6671 avatar lifei6671 commented on July 21, 2024

只有127个可以在键盘上打出来的,所以不用判断127之后的。

from interview-go.

NightmareZero avatar NightmareZero commented on July 21, 2024

只有127个可以在键盘上打出来的,所以不用判断127之后的。

只要大于127,就必然重复这个事肯定的,不过和键盘没关系,ASCII码表长度就128,不过你那个题目有点坑

保证字符串中的字符为【ASCII字符】。字符串的长度小于等于【3000】。 这句话到底是题目保证的还是要实现的啊

from interview-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.