Giter Club home page Giter Club logo

permutation's Introduction

Permutation

Soru 1- Bize öyle bi method / fonksiyon hazırlayın ki, almış olduğu iki yazı (string) parametresini ölçüp birinin herhangi bir permutasyonunun diğerinin içinde olup olmadığının mantıksal (boolean) karşılığını bize dönsün. Örnek “baba” , “abab” => true “baba”, “abc” => false “lds”, “loodos” => true

Çözüm açıklaması:

Bir string değerinin diğer bir stringin herhangi bir kombinasyonunu içerebilmesi için şu şarta uyması gerekmektedir

  • Kaynak string aranılan stringde bulunan tüm karakterleri en az aranılan stringdeki sayısı kadar içermelidir.

Örneğin:

​ String 1: abab,

​ String 2: cba

c karakteri ilk dizide olmadığı için ilk string ikinci stringin herhangi bir kombinasyonunu içeremez ve ilk string değerinin uzunluğu ile ikinci string uzunluğu aynı olmadığından kominasyon oluşmaz.

Örnek 2:

​ String 1: ababc

​ String 2: ccba

​ İkinci dizide 2 adet bulunan c karakteri ilk dizide yalnızca bir adet olduğundan, ilk string ikinci stringin herhangi bir kombinasyonunu içeremez.

Örnek 2:

​ String 1: ababccc

​ String 2: ccba

​ String 1 string 2 ye ait en az bir kombinasyonu içerir.

Sorunun çözümüne bu şekilde yaklaşırsak. Verilen stringleri karakterlerine göre gruplayıp ardından ardından kaynak grubun aranılan gruba ait tüm karakterleri en az aranılan gruptaki karakter sayıları kadar içermesi kontrol edilecektir.

permutation's People

Contributors

cagdaskaraca avatar

Watchers

James Cloos avatar  avatar

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.