GithubHelp home page GithubHelp logo

Comments (4)

domenic99 avatar domenic99 commented on July 16, 2024

@rakvium check out my new commit 0a8a515

from trainee-rep.

rakvium avatar rakvium commented on July 16, 2024
2.3.1 :009 > 'ZZCCC'.beauty
 => 128 
2.3.1 :010 > 'CCCZZ'.beauty
 => 127 

@domenic99, letters' positions should not affect the result, only letters quantities should.

from trainee-rep.

domenic99 avatar domenic99 commented on July 16, 2024

@rakvium Here you go 33e32e0

from trainee-rep.

rakvium avatar rakvium commented on July 16, 2024

@domenic99, again, letters' positions shouldn't affect the result, only frequency of letter in a string should.

2.3.1 :008 > 'CCZCC'.beauty
 => 126 
2.3.1 :009 > 'ZZZCZ'.beauty
 => 129 

(should be 129 in both cases)

By the way, you have RuboCop offenses again:

domenic99/trainee-rep/Jack-task$ rubocop
Inspecting 1 file
W

Offenses:

jack_task.rb:6:28: W: Do not use prefix _ for a variable that is used.
    freq = freq.sort_by { |_key, value| _key }.reverse.to_h
                           ^^^^
jack_task.rb:6:34: W: Unused block argument - value. If it's necessary, use _ or _value as an argument name to indicate that it won't be used.
    freq = freq.sort_by { |_key, value| _key }.reverse.to_h
                                 ^^^^^

1 file inspected, 2 offenses detected

from trainee-rep.

Related Issues (11)

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.