9876543211 Goto Github PK
Name: guohui.Deng
Type: User
Company: Techbank.co.jp
Location: Tokyo, BIT
Name: guohui.Deng
Type: User
Company: Techbank.co.jp
Location: Tokyo, BIT
A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N. For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has binary representation 10100 and contains one binary gap of length 1. The number 15 has binary representation 1111 and has no binary gaps. Write a function: class Solution { public int solution(int N); } that, given a positive integer N, returns the length of its longest binary gap. The function should return 0 if N doesn't contain a binary gap. For example, given N = 1041 the function should return 5, because N has binary representation 10000010001 and so its longest binary gap is of length 5. Assume that: N is an integer within the range [1..2,147,483,647]. Complexity: expected worst-case time complexity is O(log(N)); expected worst-case space complexity is O(1).
A treasure chest for image classification powered by PaddlePaddle
Implement Queue, which should be immutable, generic class, and function as a queue.
以下の4メソッドを持つExamSummaryクラスを作成せよ。 /** * 学籍番号,科目,得点を登録する */ void register(String 学籍番号 , Subject 科目 , int 得点); /** * 引数で指定された学籍番号・科目の得点を返す * @return 得点 */ int getScore(String 学籍番号, Subject 科目); /** * 引数で指定された科目の最高得点の学籍番号を返す * @return 学籍番号のリスト */ List<String> getTopScoreIdsBySubject(Subject 科目); /** * 全科目の平均得点の高い順に学籍番号を返す * @return 学籍番号のリスト */ List<String> getIdsByAverage(); なおSubjectは以下のような定義でよい。 enum Subject { MATH, SCIENCE, ENGLISH } 使用例) ExamSummary es = new ExamSummary(); es.register ("00kc001",Subject.MATH , 85); es.register ("00kc001",Subject.SCIENCE , 75); es.register ("00kc001",Subject.ENGLISH , 65); es.register ("00kc002",Subject.MATH , 60); es.register ("00kc002",Subject.SCIENCE , 80); es.register ("00kc002",Subject.ENGLISH , 70); es.register ("00kc003",Subject.MATH , 90); es.register ("00kc003",Subject.SCIENCE , 55); es.register ("00kc003",Subject.ENGLISH , 65); int score = es.getScore("00kc002",Subject.MATH); List<String> topScoreIds = es.getTopScoreIdsBySubject(Subject.ENGLISH); List<String> ids = es.getIdsByAverage();
A thread-safe Splitter class, which can split char, string, regex expression, fixed length
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.