保存されている過去のバージョンの一覧

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年04月30日15時42分35秒
Last modified: 2021年06月07日19時37分23秒 (by laycrs)
Tags: Competitive_Programming_Incomplete LeetCode
トップページに戻る

Logged in as: unknown user (not login)

ログイン: