題目:https://leetcode.com/problems/linked-list-in-binary-tree/
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
這題是premium才能看的題,不過google可以找到,一樣複製過來,希望之後找的可以是非premium都能使用的題目
Remove Vowels from a String
Given a string S, remove the vowels 'a', 'e', 'i', 'o', and 'u' from it, and return the new string.
Example 1:
Input: "leetcodeisacommunityforcoders"
Output: "ltcdscmmntyfrcdrs"
Example 2:
Input: "aeiou"
Output: ""
在training階段學習到p(z), 也就是prior
後於使用model時,從p(x) mapping 到p(z), 再由prior mapping 出x'。
下述三個機率先置知識,放在另一個hackmd內:
Maximum Likelihood Estimation(MLE)
Maximum a Posterior(MAP)
Marginal Likelihood
https://hackmd.io/5gu5SPJzR1qJvOVZ_mMSHg
VAE main
題目:輸入一list nums, 及一target, 目標先對nums排列,再找出在nums中target的索引, 以list輸出
Example 1:
Input: nums = [1,2,5,2,3], target = 2
Output: [1,2]
Explanation: After sorting, nums is [1,2,2,3,5].
The indices where nums[i] == 2 are 1 and 2.
Example 2: