package
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: May 19, 2019
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
< Previous
Next >
984. String Without AAA or BBB (Medium)
Given two integers A
and B
, return any string S
such that:
S
has length A + B
and contains exactly A
'a'
letters, and exactly B
'b'
letters;
- The substring
'aaa'
does not occur in S
;
- The substring
'bbb'
does not occur in S
.
Example 1:
Input: A = 1, B = 2
Output: "abb"
Explanation: "abb", "bab" and "bba" are all correct answers.
Example 2:
Input: A = 4, B = 1
Output: "aabaa"
Note:
0 <= A <= 100
0 <= B <= 100
- It is guaranteed such an
S
exists for the given A
and B
.
[Greedy]
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.