2021年06月07日19時37分23秒に更新されたバージョンを表示しています.
最新のページはこちらをご覧ください.


LeetCode Weekly Contest 243 1問目 - Check if Word Equals Summation of Two Words [1880]

Source

LeetCode Weekly Contest 243
問題文

問題概要

省略

解法

省略

cLayversion 20210607-1)のコード

C++に変換後のコードはこちら

#define main dummy_main
{}
#undef main

int calc(string s){
  int res = 0;
  for(auto i : s) res = 10 * res + i - 'a';
  return res;
}

class Solution {
public:
  bool isSumEqual(string firstWord, string secondWord, string targetWord) {
    return calc(firstWord) + calc(secondWord) == calc(targetWord);
  }
};

Current time: 2024年05月18日02時22分12秒
Last modified: 2021年06月07日19時37分23秒 (by laycrs)
Tags: Competitive_Programming_Incomplete LeetCode
トップページに戻る

Logged in as: unknown user (not login)

ログイン: