Skip to content

409. Longest Palindrome#17

Open
ryosuketc wants to merge 1 commit intomainfrom
409_longest_palindrome
Open

409. Longest Palindrome#17
ryosuketc wants to merge 1 commit intomainfrom
409_longest_palindrome

Conversation

@ryosuketc
Copy link
Owner


### step1

* 最初、与えられた文字列の substring の中で最長の文字列を返すのかと思って 10 分くらい考えながら書いていた。途中で問題設定が違っているのに気付いたのでやり直し
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そっちの問題もあったはずです。

int longestPalindrome(string s) {
std::unordered_map<char, int> char_to_frequency;
bool has_odd_frequency = false;
int palindrome_length = 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

変数の宣言遅らせてもいいでしょう。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants