This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
/*** How to create variables and constants */ | |
var greeting = "Hello, playground" | |
var name = "Ted" | |
name = "Rebecca" | |
name = "Keeley" | |
let character = "Daphne" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Launching lib/main.dart on Android SDK built for x86 in debug mode... | |
Running Gradle task 'assembleDebug'... | |
FAILURE: Build failed with an exception. | |
* What went wrong: | |
Execution failed for task ':app:processDebugResources'. | |
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade | |
> Android resource linking failed | |
/Users/necrowman/.gradle/caches/transforms-2/files-2.1/0037f3ef0376f5558a83f35172c94a4f/jetified-facebook-share-4.42.0/res/drawable/com_facebook_button_send_background.xml:27: AAPT: error: resource color/com_facebook_button_background_color_focused_disabled (aka com.robokit.heatlywaves:color/com_facebook_button_background_color_focused_disabled) not found. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSObject+FullDescription.h | |
// DebuggingTools | |
// | |
// Created by Ruslan Yupyn on 2/14/19. | |
// Copyright © 2019 necrowman. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func createURLWithComponents(with instance: String) -> URL? { | |
let urlComponents = NSURLComponents() | |
urlComponents.scheme = "https" | |
urlComponents.host = instance | |
urlComponents.path = "/some/path" | |
let key1 = URLQueryItem(name: "some_key", value: "some_value") | |
let key2 = URLQueryItem(name: "some_key_2", value: "123") | |
urlComponents.queryItems = [key1, key2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: Sqrt(x) | |
/** Implement int sqrt(int x). | |
* Compute and return the square root of x. | |
* x is guaranteed to be a non-negative integer. | |
* | |
* --------------------------------------------- | |
* Example 1: | |
* | |
* Input: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: Add Binary | |
class Solution { | |
func addBinary2(_ a: String, _ b: String) -> String { | |
var minStr = a | |
var maxStr = b | |
if a.count > b.count { | |
minStr = b | |
maxStr = a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: Plus One | |
class Solution { | |
func plusOne(_ digits: [Int]) -> [Int] { | |
var arr = digits | |
var newArr = [Int]() | |
var overClock = 0 | |
let count = digits.count - 1 | |
arr[count] = arr[count] + 1 | |
for i in 0...count { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: Length of Last Word | |
class Solution { | |
func lengthOfLastWord(_ s: String) -> Int { | |
return s.isEmpty ? 0 : s.split(separator: " ").last?.count ?? 0 | |
} | |
} | |
let s = Solution() | |
s.lengthOfLastWord("Hello World") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: Implement strStr() | |
class Solution { | |
func strStr(_ haystack: String, _ needle: String) -> Int { | |
guard !needle.isEmpty else { return 0 } | |
if needle.count > haystack.count { return -1 } | |
for i in 0...(haystack.count-needle.count) { | |
let substr = String(Array(haystack)[i..<(i+needle.count)]) | |
if substr == needle { | |
return i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: Valid Palindrome | |
class Solution { | |
func isPalindrome(_ s: String) -> Bool { | |
let symbolsString = s.filter { ch in | |
return self.isCheckedSymbol(ch) | |
} | |
let symbols = symbolsString.lowercased().reversed() | |
return String(symbols) == String(symbols.reversed()) | |
} |
NewerOlder