DullCodes’s diary

programming,c++,python,MachineLearning,Math,Django,Competitive

2020-03-08から1日間の記事一覧

Leetcode Easy 876. Middle of the Linked List

Statement Example Constrains Answer 1 Statement Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middle node. Example Example 1: Input: [1,2,3,…

AtCoder 日/立/製/作/所 コンテスト

A B まとめ 無理だね A https://atcoder.jp/contests/hitachi2020/tasks/hitachi2020_a 問題文を適当に読んでいて一回WA ちゃんと見たら意味がわからなくなったので 考えたことを全部コードにぶち込む #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n);</bits/stdc++.h>…

Leetcode Easy 344. Reverse String

Statement Example Constrains Answer 1 Answer 2 Statement Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, you must do this by modifying the …

Leetcode Easy 1160. Find Words That Can Be Formed by Characters

Statement Example Constrains Answer 1 Statement You are given an array of strings words and a string chars. A string is good if it can be formed by characters from chars (each character can only be used once). Return the sum of lengths of …

Leetcode Easy 1122. Relative Sort Array

Statement Example Constrains Answer 1 Statement Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1. Sort the elements of arr1 such that the relative ordering of items in arr1 are th…