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 React, { useRef } from 'react'; | |
import { View, Dimensions } from 'react-native'; | |
import util from 'helpers/util'; | |
const useAutoScroll = () => { | |
const yCoordinates = useRef({}); | |
let scrollRef = null; | |
const setScrollRef = ref => { | |
if (ref) scrollRef = ref; |
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 React, { useState, useEffect, useContext } from 'react'; | |
import { View, ScrollView } from 'react-native'; | |
import { Button, TextInput } from 'MyCustomComponents'; | |
import useAutoScroll from 'useAutoScroll'; | |
import { Controller, FormContext, useForm } from 'react-hook-form'; | |
function SampleForm({ navigation }) { | |
const { setScrollRef, scrollTracker, scrollTo, captureRef } = useAutoScroll(); | |
const useFormObj = useForm({ |
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
answers = open('input_test.txt').read().replace('\r\n', '\n').replace('\n\n', '|').replace('\n', ' ').split('|') | |
part1 = 0 | |
part2 = 0 | |
for answer in answers: | |
part1 += len(set(answer.replace(' ', ''))) | |
part2 += len(set.intersection(*map(set, answer.split()))) | |
print(answer, '--->', list(map(set, answer.split()))) |