7 kyu

Simple Fun #30: Strings Construction

431 of 1,115myjinxin2015

Description:

Task

How many strings equal to A can be constructed using letters from the string B? Each letter can be used only once and in one string only.

Example

For A = "abc" and B = "abccba", the output should be 2.

We can construct 2 strings A with letters from B.

Input/Output

  • [input] string A

    String to construct, A contains only lowercase English letters.

    Constraints: 3 ≤ A.length ≤ 9.

  • [input] string B

    String containing needed letters, B contains only lowercase English letters.

    Constraints: 3 ≤ B.length ≤ 50.

  • [output] an integer

Puzzles

Stats:

CreatedJan 24, 2017
PublishedJan 24, 2017
Warriors Trained3116
Total Skips65
Total Code Submissions5206
Total Times Completed1115
JavaScript Completions431
C# Completions115
Python Completions578
C Completions26
TypeScript Completions25
Total Stars50
% of votes with a positive feedback rating93% of 221
Total "Very Satisfied" Votes191
Total "Somewhat Satisfied" Votes28
Total "Not Satisfied" Votes1
Total Rank Assessments6
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • myjinxin2015 Avatar
  • kazk Avatar
  • user7657844 Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • dfhwze Avatar
  • yLaWy Avatar
  • HartlIKS Avatar
Ad