This file contains hidden or 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
| """ | |
| This is the solution for: https://leetcode.com/problems/find-the-index-of-permutation/description/ | |
| It is not available without premium though | |
| Given an array perm of length n which is a permutation of [1, 2, ..., n], return the index of perm in the lexicographically sorted array of all of the permutations of [1, 2, ..., n]. | |
| Since the answer may be very large, return it modulo 10^9 + 7. | |
| Example 1: |
This file contains hidden or 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
| #include <string> | |
| #include <iostream> | |
| #include <fstream> | |
| #include <map> | |
| #include <locale> | |
| #include <vector> | |
| #include <algorithm> | |
| void countWords(std::ifstream &in, std::map<std::string, int> &result) { | |
| std::string word; |
This file contains hidden or 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
| package; | |
| import haxe.macro.Expr; | |
| class Bar { | |
| public var foo:Foo = null; | |
| public function new() {} | |
| } | |
| class Foo { | |
| public function new() {} |
This file contains hidden or 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
| package; | |
| import haxe.io.Bytes; | |
| import kha.Image; | |
| #if sys_kore | |
| @:cppFileCode(' | |
| #include <Kore/Graphics/stb_image.h> | |
| #ifndef INCLUDED_kha_graphics4_TextureFormat | |
| #include <kha/graphics4/TextureFormat.h> |
This file contains hidden or 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
| //add this to html to use in js: <script src="pako_inflate.min.js"></script> | |
| //also put this file near html file: https://github.com/nodeca/pako/blob/master/dist/pako_inflate.min.js | |
| function unzipEntry(entry:haxe.zip.Entry) { | |
| #if flash | |
| if (entry.compressed) { | |
| var data = entry.data.getData(); | |
| data.inflate(); | |
| entry.data = Bytes.ofData(data); | |
| } |