You are not logged in. Please login at www.codechef.com to post your questions!

×

HARRY - Editorial

PROBLEM LINK:

Practice Contest

Author: mesksr Editorialist: mesksr

DIFFICULTY:

CAKEWALK

PREREQUISITES:

Strings

PROBLEM:

Given a main string (potion) and several other strings (ingredients). We need to find if potion can be made.

EXPLANATION:

We need to create two counter arrays of size 26. In first counter array record the frequency of each alphabet ('a' to 'z') from potion. In second counter array record the frequency of each alphabet ('a' to 'z') from all ingredients. If for any alphabet ('a' to 'z'), corresponding frequency from potion > corresponding frequency from all ingredients, then potion cannot be made.

AUTHOR'S SOLUTION:

Author's solution can be found here.

asked 23 Mar '16, 17:17

mesksr's gravatar image

5★mesksr
3
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,646
×643

question asked: 23 Mar '16, 17:17

question was seen: 362 times

last updated: 23 Mar '16, 17:17