Skip to content

Instantly share code, notes, and snippets.

View yuhao-git-star's full-sized avatar
🌏

yuhao yuhao-git-star

🌏
  • San Francisco
View GitHub Profile
import Foundation
// Question 1
var dictionary1 = ["Hi","Hello","HelloWorld", "HiWorld", "HelloWorldWideWeb", "HelloWWWW"]
var dictionary2 = ["Oursky","OurSky","OurskyLimited", "OurskyHK", "SkymakersDigitalLTD", "SkymakersDigitalLtd"]
// O(n * m) => n = dictionary count, m = sum(every words's char)
// 分析,本題中有提到 ID, IP 這種連續大寫字母的縮寫只能算一個單詞。所以設計一個判斷,當連續為大寫時不計入單詞。
func findMaxWords(words: [String]) -> String {
var maxWordsCount = 0
import Foundation
import SwiftUI
struct GradientCircle: View {
var body: some View {
let color1 = Color.init(red: 81/255, green: 204/255, blue: 159/255)
let color2 = Color.init(red: 154/255, green: 255/255, blue: 248/255)
let spectrum = Gradient(colors: [ color1, color2])
let conic =
LinearGradient(gradient: spectrum, startPoint: UnitPoint(x: 0, y: 0.5), endPoint: UnitPoint(x: 0.5, y: 1))
@yuhao-git-star
yuhao-git-star / Fastfile
Created July 19, 2019 13:21 — forked from rodydavis/Fastfile
Top-level Fastfile for Flutter
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
@yuhao-git-star
yuhao-git-star / download.js
Created January 30, 2019 07:36 — forked from gregbarcza/download.js
Download all image from cloudinary
'use strict'
const cloudinary = require('cloudinary')
const Promise = require('bluebird')
const co = require('co')
const fs = Promise.promisifyAll(require('fs'))
const request = require('request')
const moment = require('moment')
// FILL THIS
cloudinary.config({
cloud_name: '',
class CircleView : UIView {
override func draw(_ rect: CGRect) {
let 畫筆 = UIBezierPath()
畫筆.move(to: .zero)
// 畫筆.addLine(to: CGPoint(x: 100, y: 100))
// x^2 + y^2 = r^2
class CircleView : UIView {
override func draw(_ rect: CGRect) {
let 畫筆 = UIBezierPath()
畫筆.move(to: .zero)
// 畫筆.addLine(to: CGPoint(x: 100, y: 100))
// x^2 + y^2 = r^2
import UIKit
class CircleView : UIView {
override func draw(_ rect: CGRect) {
let 畫筆 = UIBezierPath()
畫筆.move(to: .zero)
// 畫筆.addLine(to: CGPoint(x: 100, y: 100))
class CircleView : UIView {
override func draw(_ rect: CGRect) {
let 畫筆 = UIBezierPath()
畫筆.move(to: .zero)
// 畫筆.addLine(to: CGPoint(x: 100, y: 100))
// x^2 + y^2 = r^2
class CircleView : UIView {
override func draw(_ rect: CGRect) {
let 畫筆 = UIBezierPath()
畫筆.move(to: .zero)
畫筆.addLine(to: CGPoint(x: 100, y: 100))
畫筆.stroke()
}
}
import UIKit
class CircleView : UIView {
override func draw(_ rect: CGRect) {
}
}