GithubHelp home page GithubHelp logo

nicestring-kotlin's Introduction

Nice String

We'll say a string is nice if at least two of the following conditions are satisfied:

  1. It doesn't contain substrings bu, ba or be;
  2. It contains at least three vowels (vowels are a, e, i, o and u);
  3. It contains a double letter (at least two similar letters following one another), like b in "abba".

Your task is to check whether a given string is nice. Strings for this task will consist of lowercase letters only. Note that for the purpose of this task, we don't consider 'y' as a vowel.

  • Example 1

    "bac" isn't nice. No conditions are satisfied: it contains a ba substring, contains only one vowel and no doubles.

  • Example 2

    "aza" isn't nice. Only the first condition is satisfied, but the string doesn't contain enough vowels or doubles.

  • Example 3

    "abaca" isn't nice. The second condition is satisfied: it contains three vowels a, but the other two aren't satisfied: it contains ba and no doubles.

  • Example 4

    "baaa" is nice. The conditions #2 and #3 are satisfied: it contains three vowels a and a double a.

  • Example 5

    "aaab" is nice, because all three conditions are satisfied.

nicestring-kotlin's People

Contributors

jesusgsdev avatar

Stargazers

Chandani Patibandha avatar  avatar

Watchers

James Cloos avatar

Forkers

kevinmartinezc

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.