From Cute Matamata, 5 Years ago, written in Plain Text.

A PHP Error was encountered

Severity: Warning

Message: sizeof(): Parameter must be an array or an object that implements Countable

Filename: helpers/language_helper.php

Line Number: 81

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/helpers/language_helper.php
Line: 81
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/themes/geocities/views/view/view.php
Line: 24
Function: random_expire_msg

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 173
Function: include

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 43
Function: _ci_load

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 700
Function: view

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type null

Filename: helpers/language_helper.php

Line Number: 81

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/helpers/language_helper.php
Line: 81
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/themes/geocities/views/view/view.php
Line: 24
Function: random_expire_msg

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 173
Function: include

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 43
Function: _ci_load

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 700
Function: view

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

This paste will in 1 Second.
Embed
  1. import Foundation
  2.  
  3. func validBraces(_ string:String) -> Bool {
  4.   var check = [Character]()
  5.  
  6.   for char in string {
  7.  
  8.     switch char {
  9.       case "(", "[", "{":
  10.         check.append(char)
  11.       case ")":
  12.         if let last = check.last, last == "(" {
  13.           check.removeLast()
  14.         } else {
  15.           return false
  16.         }
  17.       case "]":
  18.         if let last = check.last, last == "[" {
  19.           check.removeLast()
  20.         } else {
  21.           return false
  22.         }
  23.       case "}":
  24.         if let last = check.last, last == "{" {
  25.           check.removeLast()
  26.         } else {
  27.           return false
  28.         }
  29.       default: break
  30.     }
  31.   }
  32.   return (check.count == 0) ? true : false
  33. }